#include "Event.h"

Event::Event()
{
	m_hEvent = ::CreateEvent(NULL, FALSE, FALSE, NULL);
	::ResetEvent(m_hEvent);
}

Event::~Event()
{
}

bool Event::Wait(DWORD millis)
{
	bool result = false;
	if (WaitForSingleObject(m_hEvent, millis) == WAIT_OBJECT_0)
	{
		result = true;
	}

	return result;
}

void Event::SetEvent()
{
	::SetEvent(m_hEvent);
}

void Event::ResetEvent()
{
	::ResetEvent(m_hEvent);
}